<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!-- 异步获取登陆用户对应可见菜单 -->
	<script type="text/javascript">
		$(function(){
			/* $.ajax({
		    	url: server.url + '/manage/getMenu',
		    	type:'post',
		    	dataType:'json',
		    	async:true,
		    	success:function(data){
		    		if(data.menuList == null || data.menuList.length == 0){
		    			server.alert('没有符合当前用户权限的菜单.');
		    			return;
		    		}
		    		// 1- 组合内容
					var menuContent = '';
		    		$.each(data.menuList,function(index, item){
		    			// 外层一级菜单
		    			var menuExpand='';
		    			var menuDropdown = '';
		    			if(item.childMenu.length > 0){
		    				menuExpand = '<i class="menu-expand"></i>';
		    				menuDropdown = 'class="menu-dropdown"';
	    				}
		    			if(!verify.isNull(item.menuLink)){
		    				menuContent += '<li><a '+ menuDropdown +' href="#" onclick="server.loadContentPage(\'' + item.menuLink + '\',this, \'.agency-page-body\')" att="'+ item.id +'" att_p="'+ item.pid +'" atts="'+ item.menuLink +'"><i class="menu-icon '+ item.icon +'"></i><span class="menu-text"> ' + item.menuName + ' </span>'+ menuExpand + '</a>';
		    			}else{
		    				menuContent += '<li><a '+ menuDropdown +' href="#" att="'+item.id +'" att_p="'+ item.pid +'" atts=""><i class="menu-icon '+ item.icon +'"></i><span class="menu-text"> ' + item.menuName + ' </span>'+menuExpand + '</a>';
		    			}
		    			
		    			if(item.childMenu.length > 0){
		    				// 内层二级菜单
		    				
	    					menuContent +='<ul class="submenu">';
	    					$.each(item.childMenu,function(childIndex, childItem){
	    						menuContent += '<li><a href="#" onclick="server.loadContentPage(\'' + childItem.menuLink + '\',this, \'.agency-page-body\')" att="'+childItem.id +'" att_p="'+ childItem.pid +'" atts="'+ childItem.menuLink +'"><span class="menu-text"> ' + childItem.menuName + ' </span></a></li>';
			    			});
	    					menuContent +='</ul>';		
		    			}
		    			menuContent += '</li>';
		    		});
		    		// 2-附加到对应ul中
		    		$('#sidebar ul').html(menuContent);
		    		//checkCompanyInfoAuditStatus();
		    	},
		    	error:function(){
		    		server.alert('获取菜单数据操作发生错误, 请刷新页面重新尝试或者联系管理员进行解决.');
		    	}
		    }); */
		    
		});
		
		//校验公司基本信息的审核状态
		function checkCompanyInfoAuditStatus(){
			//1. 校验是否完善企业基本信息
     		if('${companyBasicInfoAuditStatus}' == null || '${companyBasicInfoAuditStatus}' == ''){
     			server.alert("请完善企业基本信息，企业信息审核通过后，才可以进行其他操作.");
     			clickMenu();
     		}else if('${companyBasicInfoAuditStatus}' == '0'){
     			server.alert("公司信息正在审核中，企业信息审核通过后，才可以进行其他操作");
     			clickMenu();
     		}else if('${companyBasicInfoAuditStatus}' == '2'){
     			server.alert("公司信息未通过审核，请完善信息.");
     			clickMenu();
     		}
		}
		
		function clickMenu(){
			$("#sidebar li a").each(function(i){
 				var href = $(this).attr("atts");
 				if(href == "/servicesAgency/companyInformation/identify"){
 					$(this).click();
 				}
 			});
		}
		
		function loadContentPage(url, obj, selector) {
			$.ajax({
				url : url,
				type : 'GET',
				success : function(data) {
					$(selector).html(data);
				},
				dataType : 'html',
				async : true
			});
		}
	</script>

<!-- Sidebar Menu -->
<div class="page-sidebar" id="sidebar">
     <ul class="nav sidebar-menu">
		<li class="active">
			<a href="javascript:void(0)" onclick="loadContentPage('/demo/user/list',this,'.agency-page-body')" > 
				<i class="menu-icon glyphicon glyphicon-home"></i> 
				<span class="menu-text"> 用户管理  </span>
			</a>
		</li>
			<!--Databoxes-->
		<li>
			<a href="javascript:void(0)" onclick="loadContentPage('/demo/project/list',this,'.agency-page-body')"> 
				<i class="menu-icon glyphicon glyphicon-tasks"></i> 
				<span class="menu-text"> 合同管理 </span>
			</a>
		</li>
		<!-- 文件管理 -->
		<li>
			<a href="javascript:void(0)" onclick="loadContentPage('/demo/doc/list',this,'.agency-page-body')"> 
				<i class="menu-icon glyphicon glyphicon-tasks"></i> 
				<span class="menu-text"> 文件管理 </span>
			</a>
		</li>
		
		
	</ul>
 </div>